# -*- coding: utf-8 -*-
"""
@date: 2021/6/22 9:36
@file: concatenate_use.py
@author: lilong
@desc:  keras的concatenate()函数用法
"""

"""
参考：https://blog.csdn.net/leviopku/article/details/82380710
"""


import numpy as np
import keras.backend as K
import tensorflow as tf

t1 = K.variable(np.array([[[1, 2], [2, 3]], [[4, 4], [5, 3]]]))
t2 = K.variable(np.array([[[7, 4], [8, 4]], [[2, 10], [15, 11]]]))
d0 = K.concatenate([t1, t2], axis=-2)
d1 = K.concatenate([t1, t2], axis=1)
d2 = K.concatenate([t1, t2], axis=-1)
d3 = K.concatenate([t1, t2], axis=2)

print(d0)
